<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>


  <script>
    Object.prototype[Symbol.iterator] = function () {
      let o = this; // 调用该方法的实例
      let keys = Object.keys(o); // 获取实例中要被遍历的key
      let index = 0; // 被遍历到的key的索引
      return {
        next() {
          let done = index >= 0 && index < keys.length;
          let value = done ? { propertyValue: o[keys[index]], propertyeName: keys[index] } : undefined;
          index += 1;
          return { value, done: !done }
        }
      }
    }

  </script>
</body>

</html>